const mongoose = require('mongoose');
const { ObjectId } = mongoose.Schema;

/**
 * Export model definition object.
 */
module.exports = {
  projectId: ObjectId,
  versionId: ObjectId,
  fileId: ObjectId,
  filePath: String,
  ruleId: ObjectId,
  ruleSetId: ObjectId,
  status: Number,
  level: Number,
  originalLevel: Number,
  locations: {
    begin: {
      line: Number,
      column: Number,
    },
    end: {
      line: Number,
      column: Number,
    },
  },
  message: String,
  defectNumber: Number,
  defectType: {
    type: Number, default: 1,
  },
  steps: [{
    _id: false,
    filePath: String,
    line: Number,
  }],
  description: String,
  notes: [Object],
};
